/*
 Navicat Premium Data Transfer

 Source Server         : 本地数据库
 Source Server Type    : MySQL
 Source Server Version : 80033 (8.0.33)
 Source Host           : localhost:3306
 Source Schema         : wallet

 Target Server Type    : MySQL
 Target Server Version : 80033 (8.0.33)
 File Encoding         : 65001

 Date: 25/08/2025 14:09:18
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for accounts
-- ----------------------------
DROP TABLE IF EXISTS `accounts`;
CREATE TABLE `accounts` (
  `id` int NOT NULL AUTO_INCREMENT,
  `userId` int NOT NULL COMMENT '用户ID',
  `assetId` int NOT NULL COMMENT '资产ID',
  `categoryId` int DEFAULT NULL COMMENT '类型ID',
  `status` enum('ACTIVE','FROZEN','CLOSED') NOT NULL DEFAULT 'ACTIVE' COMMENT '账户状态：活跃(ACTIVE)、冻结(FROZEN)、关闭(CLOSED)',
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '账户名称',
  `cover` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '封面',
  `totalAmount` decimal(15,2) DEFAULT NULL COMMENT '信用额度',
  `amount` decimal(15,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '余额',
  `interestRate` decimal(6,5) DEFAULT NULL COMMENT '利息率',
  `billDate` int DEFAULT NULL COMMENT '账单日',
  `dueDate` int DEFAULT NULL COMMENT '还款日',
  `assetStatStatus` tinyint NOT NULL DEFAULT '1' COMMENT '计入资产统计',
  `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '备注内容',
  `isDeleted` tinyint NOT NULL DEFAULT '0',
  `createdAt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updatedAt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=35 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

-- ----------------------------
-- Records of accounts
-- ----------------------------
BEGIN;
INSERT INTO `accounts` (`id`, `userId`, `assetId`, `categoryId`, `status`, `name`, `cover`, `totalAmount`, `amount`, `interestRate`, `billDate`, `dueDate`, `assetStatStatus`, `notes`, `isDeleted`, `createdAt`, `updatedAt`) VALUES (13, 16, 2, 11, 'ACTIVE', '招商信用卡', NULL, 67000.00, 47459.00, NULL, 16, 1, 1, NULL, 0, '2025-06-16 12:17:49', '2025-06-26 15:13:45');
INSERT INTO `accounts` (`id`, `userId`, `assetId`, `categoryId`, `status`, `name`, `cover`, `totalAmount`, `amount`, `interestRate`, `billDate`, `dueDate`, `assetStatStatus`, `notes`, `isDeleted`, `createdAt`, `updatedAt`) VALUES (19, 16, 1, 7, 'ACTIVE', '招商银行', NULL, 0.00, 0.00, NULL, NULL, NULL, 1, '8332', 0, '2025-06-26 14:03:04', '2025-06-26 14:09:50');
INSERT INTO `accounts` (`id`, `userId`, `assetId`, `categoryId`, `status`, `name`, `cover`, `totalAmount`, `amount`, `interestRate`, `billDate`, `dueDate`, `assetStatStatus`, `notes`, `isDeleted`, `createdAt`, `updatedAt`) VALUES (20, 16, 1, 7, 'ACTIVE', '招商银行', NULL, 0.00, 0.00, NULL, NULL, NULL, 1, '7188', 0, '2025-06-26 14:09:06', '2025-06-26 14:09:06');
INSERT INTO `accounts` (`id`, `userId`, `assetId`, `categoryId`, `status`, `name`, `cover`, `totalAmount`, `amount`, `interestRate`, `billDate`, `dueDate`, `assetStatStatus`, `notes`, `isDeleted`, `createdAt`, `updatedAt`) VALUES (21, 16, 1, 7, 'ACTIVE', '中国银行', NULL, 0.00, 1081.56, NULL, NULL, NULL, 1, '0119', 0, '2025-06-26 14:12:10', '2025-06-26 14:12:10');
INSERT INTO `accounts` (`id`, `userId`, `assetId`, `categoryId`, `status`, `name`, `cover`, `totalAmount`, `amount`, `interestRate`, `billDate`, `dueDate`, `assetStatStatus`, `notes`, `isDeleted`, `createdAt`, `updatedAt`) VALUES (22, 16, 1, 7, 'ACTIVE', '中国银行', NULL, 0.00, 0.00, NULL, NULL, NULL, 1, '6586', 0, '2025-06-26 14:12:50', '2025-06-26 14:12:50');
INSERT INTO `accounts` (`id`, `userId`, `assetId`, `categoryId`, `status`, `name`, `cover`, `totalAmount`, `amount`, `interestRate`, `billDate`, `dueDate`, `assetStatStatus`, `notes`, `isDeleted`, `createdAt`, `updatedAt`) VALUES (23, 16, 1, 10, 'ACTIVE', '数字人民币', NULL, 0.00, 205.00, NULL, NULL, NULL, 1, NULL, 0, '2025-06-26 14:14:11', '2025-06-26 14:14:11');
INSERT INTO `accounts` (`id`, `userId`, `assetId`, `categoryId`, `status`, `name`, `cover`, `totalAmount`, `amount`, `interestRate`, `billDate`, `dueDate`, `assetStatStatus`, `notes`, `isDeleted`, `createdAt`, `updatedAt`) VALUES (24, 16, 1, 9, 'ACTIVE', '支付宝', NULL, 0.00, 0.00, NULL, NULL, NULL, 1, NULL, 0, '2025-06-26 14:14:49', '2025-06-26 14:14:49');
INSERT INTO `accounts` (`id`, `userId`, `assetId`, `categoryId`, `status`, `name`, `cover`, `totalAmount`, `amount`, `interestRate`, `billDate`, `dueDate`, `assetStatStatus`, `notes`, `isDeleted`, `createdAt`, `updatedAt`) VALUES (25, 16, 1, 8, 'ACTIVE', '微信', NULL, 0.00, 5.80, NULL, NULL, NULL, 1, NULL, 0, '2025-06-26 14:15:09', '2025-06-26 14:15:09');
INSERT INTO `accounts` (`id`, `userId`, `assetId`, `categoryId`, `status`, `name`, `cover`, `totalAmount`, `amount`, `interestRate`, `billDate`, `dueDate`, `assetStatStatus`, `notes`, `isDeleted`, `createdAt`, `updatedAt`) VALUES (26, 16, 1, 8, 'ACTIVE', '微信', NULL, 0.00, 22693.86, NULL, NULL, NULL, 1, '储备账户', 0, '2025-06-26 14:15:32', '2025-06-26 14:15:32');
INSERT INTO `accounts` (`id`, `userId`, `assetId`, `categoryId`, `status`, `name`, `cover`, `totalAmount`, `amount`, `interestRate`, `billDate`, `dueDate`, `assetStatStatus`, `notes`, `isDeleted`, `createdAt`, `updatedAt`) VALUES (27, 16, 2, 11, 'ACTIVE', '广发信用卡', NULL, 16500.00, 15902.12, NULL, 11, 2, 1, NULL, 0, '2025-06-26 14:26:52', '2025-06-26 15:14:07');
INSERT INTO `accounts` (`id`, `userId`, `assetId`, `categoryId`, `status`, `name`, `cover`, `totalAmount`, `amount`, `interestRate`, `billDate`, `dueDate`, `assetStatStatus`, `notes`, `isDeleted`, `createdAt`, `updatedAt`) VALUES (28, 16, 2, 11, 'ACTIVE', '交通信用卡', NULL, 24000.00, 23123.99, NULL, 5, 1, 1, NULL, 0, '2025-06-26 14:30:01', '2025-06-26 15:14:16');
INSERT INTO `accounts` (`id`, `userId`, `assetId`, `categoryId`, `status`, `name`, `cover`, `totalAmount`, `amount`, `interestRate`, `billDate`, `dueDate`, `assetStatStatus`, `notes`, `isDeleted`, `createdAt`, `updatedAt`) VALUES (29, 16, 2, 11, 'ACTIVE', '民生信用卡', NULL, 61000.00, 58449.68, NULL, 27, 17, 1, NULL, 0, '2025-06-26 14:32:04', '2025-06-26 15:14:24');
INSERT INTO `accounts` (`id`, `userId`, `assetId`, `categoryId`, `status`, `name`, `cover`, `totalAmount`, `amount`, `interestRate`, `billDate`, `dueDate`, `assetStatStatus`, `notes`, `isDeleted`, `createdAt`, `updatedAt`) VALUES (30, 16, 2, 11, 'ACTIVE', '中信信用卡', NULL, 47400.00, 47459.00, NULL, 18, 7, 1, NULL, 0, '2025-06-26 14:33:52', '2025-06-26 15:14:35');
INSERT INTO `accounts` (`id`, `userId`, `assetId`, `categoryId`, `status`, `name`, `cover`, `totalAmount`, `amount`, `interestRate`, `billDate`, `dueDate`, `assetStatStatus`, `notes`, `isDeleted`, `createdAt`, `updatedAt`) VALUES (31, 16, 2, 12, 'ACTIVE', '度小满', NULL, 0.00, 101691.89, NULL, NULL, NULL, 1, NULL, 0, '2025-06-26 15:30:40', '2025-06-26 15:30:40');
INSERT INTO `accounts` (`id`, `userId`, `assetId`, `categoryId`, `status`, `name`, `cover`, `totalAmount`, `amount`, `interestRate`, `billDate`, `dueDate`, `assetStatStatus`, `notes`, `isDeleted`, `createdAt`, `updatedAt`) VALUES (32, 16, 2, 12, 'ACTIVE', '放心借', NULL, 0.00, 113580.68, NULL, NULL, NULL, 1, NULL, 0, '2025-06-26 15:31:52', '2025-06-26 15:31:52');
INSERT INTO `accounts` (`id`, `userId`, `assetId`, `categoryId`, `status`, `name`, `cover`, `totalAmount`, `amount`, `interestRate`, `billDate`, `dueDate`, `assetStatStatus`, `notes`, `isDeleted`, `createdAt`, `updatedAt`) VALUES (33, 16, 4, 21, 'ACTIVE', '住房公积金', NULL, 0.00, 130504.62, NULL, NULL, NULL, 1, NULL, 0, '2025-06-26 15:33:10', '2025-06-26 15:33:10');
COMMIT;

-- ----------------------------
-- Table structure for assets
-- ----------------------------
DROP TABLE IF EXISTS `assets`;
CREATE TABLE `assets` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键id',
  `name` varchar(255) NOT NULL,
  `userId` int NOT NULL COMMENT '用户ID',
  `parentId` int NOT NULL DEFAULT '0' COMMENT '父级ID',
  `icon` int NOT NULL,
  `type` enum('ASSET','LIABILITY') CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT 'ASSET: 资产、LIABILITY: 负债',
  `createdAt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updatedAt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

-- ----------------------------
-- Records of assets
-- ----------------------------
BEGIN;
INSERT INTO `assets` (`id`, `name`, `userId`, `parentId`, `icon`, `type`, `createdAt`, `updatedAt`) VALUES (1, '流动资金', 0, 0, 1, 'ASSET', '2025-04-23 18:00:44', '2025-06-10 15:16:31');
INSERT INTO `assets` (`id`, `name`, `userId`, `parentId`, `icon`, `type`, `createdAt`, `updatedAt`) VALUES (2, '信用账户', 0, 0, 2, 'LIABILITY', '2025-05-12 11:26:51', '2025-06-10 15:16:33');
INSERT INTO `assets` (`id`, `name`, `userId`, `parentId`, `icon`, `type`, `createdAt`, `updatedAt`) VALUES (3, '投资理财', 0, 0, 3, 'ASSET', '2025-05-12 11:27:40', '2025-06-10 15:16:36');
INSERT INTO `assets` (`id`, `name`, `userId`, `parentId`, `icon`, `type`, `createdAt`, `updatedAt`) VALUES (4, '固定资产', 0, 0, 4, 'ASSET', '2025-05-12 11:28:04', '2025-06-10 16:33:30');
INSERT INTO `assets` (`id`, `name`, `userId`, `parentId`, `icon`, `type`, `createdAt`, `updatedAt`) VALUES (5, '充值账户', 0, 0, 5, 'ASSET', '2025-05-12 11:29:13', '2025-06-10 16:33:34');
INSERT INTO `assets` (`id`, `name`, `userId`, `parentId`, `icon`, `type`, `createdAt`, `updatedAt`) VALUES (6, '现金', 0, 1, 6, 'ASSET', '2025-06-10 16:39:07', '2025-06-10 16:39:55');
INSERT INTO `assets` (`id`, `name`, `userId`, `parentId`, `icon`, `type`, `createdAt`, `updatedAt`) VALUES (7, '银行活期', 0, 1, 7, 'ASSET', '2025-06-10 16:45:17', '2025-06-10 16:45:17');
INSERT INTO `assets` (`id`, `name`, `userId`, `parentId`, `icon`, `type`, `createdAt`, `updatedAt`) VALUES (8, '微信', 0, 1, 8, 'ASSET', '2025-06-10 16:52:18', '2025-06-10 16:52:18');
INSERT INTO `assets` (`id`, `name`, `userId`, `parentId`, `icon`, `type`, `createdAt`, `updatedAt`) VALUES (9, '支付宝', 0, 1, 9, 'ASSET', '2025-06-10 16:52:18', '2025-06-10 16:52:18');
INSERT INTO `assets` (`id`, `name`, `userId`, `parentId`, `icon`, `type`, `createdAt`, `updatedAt`) VALUES (10, '其他资金', 0, 1, 10, 'ASSET', '2025-06-10 16:52:18', '2025-06-10 16:52:18');
INSERT INTO `assets` (`id`, `name`, `userId`, `parentId`, `icon`, `type`, `createdAt`, `updatedAt`) VALUES (11, '信用卡', 0, 2, 11, 'LIABILITY', '2025-06-10 16:52:18', '2025-06-10 16:52:18');
INSERT INTO `assets` (`id`, `name`, `userId`, `parentId`, `icon`, `type`, `createdAt`, `updatedAt`) VALUES (12, '网贷', 0, 2, 12, 'LIABILITY', '2025-06-10 16:52:18', '2025-06-10 16:52:18');
INSERT INTO `assets` (`id`, `name`, `userId`, `parentId`, `icon`, `type`, `createdAt`, `updatedAt`) VALUES (13, '借款', 0, 2, 13, 'LIABILITY', '2025-06-10 16:52:18', '2025-06-10 16:52:18');
INSERT INTO `assets` (`id`, `name`, `userId`, `parentId`, `icon`, `type`, `createdAt`, `updatedAt`) VALUES (14, '其他信用', 0, 2, 14, 'LIABILITY', '2025-06-10 16:52:18', '2025-06-10 16:52:18');
INSERT INTO `assets` (`id`, `name`, `userId`, `parentId`, `icon`, `type`, `createdAt`, `updatedAt`) VALUES (15, '房产', 0, 3, 15, 'ASSET', '2025-06-10 16:52:18', '2025-06-10 16:52:18');
INSERT INTO `assets` (`id`, `name`, `userId`, `parentId`, `icon`, `type`, `createdAt`, `updatedAt`) VALUES (16, '汽车', 0, 3, 16, 'ASSET', '2025-06-10 16:52:18', '2025-06-10 16:52:18');
INSERT INTO `assets` (`id`, `name`, `userId`, `parentId`, `icon`, `type`, `createdAt`, `updatedAt`) VALUES (17, '设备', 0, 3, 17, 'ASSET', '2025-06-10 16:52:18', '2025-06-10 16:52:18');
INSERT INTO `assets` (`id`, `name`, `userId`, `parentId`, `icon`, `type`, `createdAt`, `updatedAt`) VALUES (18, '其他固定资产', 0, 3, 18, 'ASSET', '2025-06-10 16:52:18', '2025-06-10 16:52:18');
INSERT INTO `assets` (`id`, `name`, `userId`, `parentId`, `icon`, `type`, `createdAt`, `updatedAt`) VALUES (19, '银行理财', 0, 4, 19, 'ASSET', '2025-06-10 16:52:18', '2025-06-10 16:52:18');
INSERT INTO `assets` (`id`, `name`, `userId`, `parentId`, `icon`, `type`, `createdAt`, `updatedAt`) VALUES (20, '存款/存单', 0, 4, 20, 'ASSET', '2025-06-10 16:52:18', '2025-06-10 16:52:18');
INSERT INTO `assets` (`id`, `name`, `userId`, `parentId`, `icon`, `type`, `createdAt`, `updatedAt`) VALUES (21, '基金', 0, 4, 21, 'ASSET', '2025-06-10 16:52:18', '2025-06-10 16:52:18');
INSERT INTO `assets` (`id`, `name`, `userId`, `parentId`, `icon`, `type`, `createdAt`, `updatedAt`) VALUES (22, '股票', 0, 4, 22, 'ASSET', '2025-06-10 16:52:18', '2025-06-10 16:52:18');
INSERT INTO `assets` (`id`, `name`, `userId`, `parentId`, `icon`, `type`, `createdAt`, `updatedAt`) VALUES (23, '个人养老金', 0, 4, 23, 'ASSET', '2025-06-10 16:52:18', '2025-06-10 16:52:18');
INSERT INTO `assets` (`id`, `name`, `userId`, `parentId`, `icon`, `type`, `createdAt`, `updatedAt`) VALUES (24, '保险', 0, 4, 24, 'ASSET', '2025-06-10 16:52:18', '2025-06-10 16:52:18');
INSERT INTO `assets` (`id`, `name`, `userId`, `parentId`, `icon`, `type`, `createdAt`, `updatedAt`) VALUES (25, '其他理财', 0, 4, 25, 'ASSET', '2025-06-10 16:52:18', '2025-06-10 16:52:18');
INSERT INTO `assets` (`id`, `name`, `userId`, `parentId`, `icon`, `type`, `createdAt`, `updatedAt`) VALUES (26, '话费', 0, 5, 26, 'ASSET', '2025-06-10 16:52:18', '2025-06-10 16:52:18');
INSERT INTO `assets` (`id`, `name`, `userId`, `parentId`, `icon`, `type`, `createdAt`, `updatedAt`) VALUES (27, '公交卡', 0, 5, 27, 'ASSET', '2025-06-10 16:52:18', '2025-06-10 16:52:18');
INSERT INTO `assets` (`id`, `name`, `userId`, `parentId`, `icon`, `type`, `createdAt`, `updatedAt`) VALUES (28, '饭卡', 0, 5, 28, 'ASSET', '2025-06-10 16:52:18', '2025-06-10 16:52:18');
INSERT INTO `assets` (`id`, `name`, `userId`, `parentId`, `icon`, `type`, `createdAt`, `updatedAt`) VALUES (29, '会员卡', 0, 5, 29, 'ASSET', '2025-06-10 16:52:18', '2025-06-10 16:52:18');
INSERT INTO `assets` (`id`, `name`, `userId`, `parentId`, `icon`, `type`, `createdAt`, `updatedAt`) VALUES (30, '加油卡', 0, 5, 30, 'ASSET', '2025-06-10 16:52:18', '2025-06-10 16:52:18');
INSERT INTO `assets` (`id`, `name`, `userId`, `parentId`, `icon`, `type`, `createdAt`, `updatedAt`) VALUES (31, '押金', 0, 5, 31, 'ASSET', '2025-06-10 16:52:18', '2025-06-10 16:52:18');
INSERT INTO `assets` (`id`, `name`, `userId`, `parentId`, `icon`, `type`, `createdAt`, `updatedAt`) VALUES (32, '其他账户', 0, 5, 32, 'ASSET', '2025-06-10 16:52:18', '2025-06-10 16:52:18');
COMMIT;

-- ----------------------------
-- Table structure for transactions
-- ----------------------------
DROP TABLE IF EXISTS `transactions`;
CREATE TABLE `transactions` (
  `id` int NOT NULL AUTO_INCREMENT,
  `userId` int NOT NULL COMMENT '用户ID',
  `assetId` int NOT NULL COMMENT '资产ID',
  `accountId` int NOT NULL COMMENT '账户ID',
  `relatedAccountId` int DEFAULT NULL COMMENT '关联账户ID',
  `amount` decimal(15,2) NOT NULL DEFAULT '0.00' COMMENT '金额',
  `action` enum('INCOME','EXPENSE','TRANSFER','ADJUSTMENT') CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '收入(INCOME) 支出(EXPENSE) 转账(TRANSFER) 调整(ADJUSTMENT)',
  `balanceBefore` decimal(15,2) NOT NULL COMMENT '交易前账户余额',
  `balanceAfter` decimal(15,2) NOT NULL COMMENT '交易后账户余额',
  `transactionDate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '交易时间',
  `notes` text COMMENT '备注内容',
  `isDeleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '删除状态：是(1) 否(0)',
  `createdAt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updatedAt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

-- ----------------------------
-- Records of transactions
-- ----------------------------
BEGIN;
INSERT INTO `transactions` (`id`, `userId`, `assetId`, `accountId`, `relatedAccountId`, `amount`, `action`, `balanceBefore`, `balanceAfter`, `transactionDate`, `notes`, `isDeleted`, `createdAt`, `updatedAt`) VALUES (2, 16, 2, 13, NULL, 47459.00, 'ADJUSTMENT', 0.00, 47459.00, '2025-06-16 12:17:49', NULL, 0, '2025-06-16 12:17:49', '2025-06-30 10:42:19');
INSERT INTO `transactions` (`id`, `userId`, `assetId`, `accountId`, `relatedAccountId`, `amount`, `action`, `balanceBefore`, `balanceAfter`, `transactionDate`, `notes`, `isDeleted`, `createdAt`, `updatedAt`) VALUES (3, 16, 1, 19, NULL, 0.00, 'ADJUSTMENT', 0.00, 0.00, '2025-06-26 14:03:04', NULL, 0, '2025-06-26 14:03:04', '2025-06-26 14:03:04');
INSERT INTO `transactions` (`id`, `userId`, `assetId`, `accountId`, `relatedAccountId`, `amount`, `action`, `balanceBefore`, `balanceAfter`, `transactionDate`, `notes`, `isDeleted`, `createdAt`, `updatedAt`) VALUES (4, 16, 1, 20, NULL, 0.00, 'ADJUSTMENT', 0.00, 0.00, '2025-06-26 14:09:06', NULL, 0, '2025-06-26 14:09:06', '2025-06-26 14:09:06');
INSERT INTO `transactions` (`id`, `userId`, `assetId`, `accountId`, `relatedAccountId`, `amount`, `action`, `balanceBefore`, `balanceAfter`, `transactionDate`, `notes`, `isDeleted`, `createdAt`, `updatedAt`) VALUES (5, 16, 1, 21, NULL, 1081.56, 'ADJUSTMENT', 0.00, 1081.56, '2025-06-26 14:12:10', NULL, 0, '2025-06-26 14:12:10', '2025-06-26 14:12:10');
INSERT INTO `transactions` (`id`, `userId`, `assetId`, `accountId`, `relatedAccountId`, `amount`, `action`, `balanceBefore`, `balanceAfter`, `transactionDate`, `notes`, `isDeleted`, `createdAt`, `updatedAt`) VALUES (6, 16, 1, 22, NULL, 0.00, 'ADJUSTMENT', 0.00, 0.00, '2025-06-26 14:12:50', NULL, 0, '2025-06-26 14:12:50', '2025-06-26 14:12:50');
INSERT INTO `transactions` (`id`, `userId`, `assetId`, `accountId`, `relatedAccountId`, `amount`, `action`, `balanceBefore`, `balanceAfter`, `transactionDate`, `notes`, `isDeleted`, `createdAt`, `updatedAt`) VALUES (7, 16, 1, 23, NULL, 205.00, 'ADJUSTMENT', 0.00, 205.00, '2025-06-26 14:14:11', NULL, 0, '2025-06-26 14:14:11', '2025-06-26 14:14:11');
INSERT INTO `transactions` (`id`, `userId`, `assetId`, `accountId`, `relatedAccountId`, `amount`, `action`, `balanceBefore`, `balanceAfter`, `transactionDate`, `notes`, `isDeleted`, `createdAt`, `updatedAt`) VALUES (8, 16, 1, 24, NULL, 0.00, 'ADJUSTMENT', 0.00, 0.00, '2025-06-26 14:14:49', NULL, 0, '2025-06-26 14:14:49', '2025-06-26 14:14:49');
INSERT INTO `transactions` (`id`, `userId`, `assetId`, `accountId`, `relatedAccountId`, `amount`, `action`, `balanceBefore`, `balanceAfter`, `transactionDate`, `notes`, `isDeleted`, `createdAt`, `updatedAt`) VALUES (9, 16, 1, 25, NULL, 5.80, 'ADJUSTMENT', 0.00, 5.80, '2025-06-26 14:15:09', NULL, 0, '2025-06-26 14:15:09', '2025-06-26 14:15:09');
INSERT INTO `transactions` (`id`, `userId`, `assetId`, `accountId`, `relatedAccountId`, `amount`, `action`, `balanceBefore`, `balanceAfter`, `transactionDate`, `notes`, `isDeleted`, `createdAt`, `updatedAt`) VALUES (10, 16, 1, 26, NULL, 22693.86, 'ADJUSTMENT', 0.00, 22693.86, '2025-06-26 14:15:32', NULL, 0, '2025-06-26 14:15:32', '2025-06-26 14:15:32');
INSERT INTO `transactions` (`id`, `userId`, `assetId`, `accountId`, `relatedAccountId`, `amount`, `action`, `balanceBefore`, `balanceAfter`, `transactionDate`, `notes`, `isDeleted`, `createdAt`, `updatedAt`) VALUES (11, 16, 2, 27, NULL, 15902.12, 'ADJUSTMENT', 0.00, 15902.12, '2025-06-26 14:26:52', NULL, 0, '2025-06-26 14:26:52', '2025-06-26 15:15:50');
INSERT INTO `transactions` (`id`, `userId`, `assetId`, `accountId`, `relatedAccountId`, `amount`, `action`, `balanceBefore`, `balanceAfter`, `transactionDate`, `notes`, `isDeleted`, `createdAt`, `updatedAt`) VALUES (12, 16, 2, 28, NULL, 23123.99, 'ADJUSTMENT', 0.00, 23123.99, '2025-06-26 14:30:01', NULL, 0, '2025-06-26 14:30:01', '2025-06-26 15:16:14');
INSERT INTO `transactions` (`id`, `userId`, `assetId`, `accountId`, `relatedAccountId`, `amount`, `action`, `balanceBefore`, `balanceAfter`, `transactionDate`, `notes`, `isDeleted`, `createdAt`, `updatedAt`) VALUES (13, 16, 2, 29, NULL, 58449.68, 'ADJUSTMENT', 0.00, 58449.68, '2025-06-26 14:32:04', NULL, 0, '2025-06-26 14:32:04', '2025-06-26 15:16:37');
INSERT INTO `transactions` (`id`, `userId`, `assetId`, `accountId`, `relatedAccountId`, `amount`, `action`, `balanceBefore`, `balanceAfter`, `transactionDate`, `notes`, `isDeleted`, `createdAt`, `updatedAt`) VALUES (14, 16, 2, 30, NULL, 47459.00, 'ADJUSTMENT', 0.00, 47459.00, '2025-06-26 14:33:52', NULL, 0, '2025-06-26 14:33:52', '2025-06-26 15:16:55');
INSERT INTO `transactions` (`id`, `userId`, `assetId`, `accountId`, `relatedAccountId`, `amount`, `action`, `balanceBefore`, `balanceAfter`, `transactionDate`, `notes`, `isDeleted`, `createdAt`, `updatedAt`) VALUES (15, 16, 2, 31, NULL, 101691.89, 'ADJUSTMENT', 0.00, 101691.89, '2025-06-26 15:30:40', NULL, 0, '2025-06-26 15:30:40', '2025-06-26 15:30:40');
INSERT INTO `transactions` (`id`, `userId`, `assetId`, `accountId`, `relatedAccountId`, `amount`, `action`, `balanceBefore`, `balanceAfter`, `transactionDate`, `notes`, `isDeleted`, `createdAt`, `updatedAt`) VALUES (16, 16, 2, 32, NULL, 113580.68, 'ADJUSTMENT', 0.00, 113580.68, '2025-06-26 15:31:52', NULL, 0, '2025-06-26 15:31:52', '2025-06-26 15:31:52');
INSERT INTO `transactions` (`id`, `userId`, `assetId`, `accountId`, `relatedAccountId`, `amount`, `action`, `balanceBefore`, `balanceAfter`, `transactionDate`, `notes`, `isDeleted`, `createdAt`, `updatedAt`) VALUES (17, 16, 4, 33, NULL, 130504.62, 'ADJUSTMENT', 0.00, 130504.62, '2025-06-26 15:33:10', NULL, 0, '2025-06-26 15:33:10', '2025-06-26 15:33:10');
INSERT INTO `transactions` (`id`, `userId`, `assetId`, `accountId`, `relatedAccountId`, `amount`, `action`, `balanceBefore`, `balanceAfter`, `transactionDate`, `notes`, `isDeleted`, `createdAt`, `updatedAt`) VALUES (21, 18, 2, 34, NULL, 39999.00, 'ADJUSTMENT', 0.00, 39999.00, '2025-07-07 12:45:27', NULL, 0, '2025-07-07 12:45:27', '2025-07-07 12:45:27');
COMMIT;

-- ----------------------------
-- Table structure for users
-- ----------------------------
DROP TABLE IF EXISTS `users`;
CREATE TABLE `users` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键id',
  `username` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '账号',
  `password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '密码',
  `phone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '手机号',
  `nickname` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '昵称',
  `avatar` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '头像地址',
  `status` blob NOT NULL COMMENT '启用状态',
  `createdAt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updatedAt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

-- ----------------------------
-- Records of users
-- ----------------------------
BEGIN;
INSERT INTO `users` (`id`, `username`, `password`, `phone`, `nickname`, `avatar`, `status`, `createdAt`, `updatedAt`) VALUES (16, 'colin', '600e4170eade56dd7897daff5018c6ff', '', '', '', 0x31, '2025-04-18 14:09:51', '2025-04-18 14:09:51');
INSERT INTO `users` (`id`, `username`, `password`, `phone`, `nickname`, `avatar`, `status`, `createdAt`, `updatedAt`) VALUES (18, 'linhang', '600e4170eade56dd7897daff5018c6ff', '', '', '', 0x31, '2025-06-16 19:03:46', '2025-06-16 19:03:46');
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
